/** nextTick也是node里独有的*/
setTimeout(() => {
  console.log('setTimeout1');
  Promise.resolve().then(() => console.log('promise1'));
}, 0);

setTimeout(() => {
  console.log('setTimeout2');
  Promise.resolve().then(() => console.log('promise2'));
}, 0);


setImmediate(() => {
  console.log('setImmediate1');
  Promise.resolve().then(() => console.log('promise3'));
}, 0);


process.nextTick(() => {
  console.log('nextTick1');
  Promise.resolve().then(() => console.log('promise4'));
  process.nextTick(() => {
    console.log('nextTick2');
    Promise.resolve().then(() => console.log('promise5'));
    process.nextTick(()=>{
      console.log('nextTick3');
    })
  });
});

//n1 n2 n3 p4 p5 s1 p1 s2 p2 si1 p3

/** 这里的setImmediate一定会在setTimeout后面执行,因为微任务清空后就会*/
